package com.ruoyi.erp.service.impl;

import com.ruoyi.erp.domain.Vendor;
import com.ruoyi.erp.mapper.VendorMapper;
import com.ruoyi.erp.service.IVendorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 供应商Service业务层处理
 * 
 * @author ztj
 * @date 2024-08-21
 */
@Service
public class VendorServiceImpl implements IVendorService 
{
    @Autowired
    private VendorMapper vendorMapper;

    /**
     * 查询供应商
     * 
     * @param cVenCode 供应商主键
     * @return 供应商
     */
    @Override
    public Vendor selectVendorByCVenCode(String cVenCode)
    {
        return vendorMapper.selectVendorByCVenCode(cVenCode);
    }

    /**
     * 查询供应商列表
     * 
     * @param vendor 供应商
     * @return 供应商
     */
    @Override
    public List<Vendor> selectVendorList(Vendor vendor)
    {
        return vendorMapper.selectVendorList(vendor);
    }

    /**
     * 新增供应商
     * 
     * @param vendor 供应商
     * @return 结果
     */
    @Override
    public int insertVendor(Vendor vendor)
    {
        return vendorMapper.insertVendor(vendor);
    }

    /**
     * 修改供应商
     * 
     * @param vendor 供应商
     * @return 结果
     */
    @Override
    public int updateVendor(Vendor vendor)
    {
        return vendorMapper.updateVendor(vendor);
    }

    /**
     * 批量删除供应商
     * 
     * @param cVenCodes 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteVendorByCVenCodes(String[] cVenCodes)
    {
        return vendorMapper.deleteVendorByCVenCodes(cVenCodes);
    }

    /**
     * 删除供应商信息
     * 
     * @param cVenCode 供应商主键
     * @return 结果
     */
    @Override
    public int deleteVendorByCVenCode(String cVenCode)
    {
        return vendorMapper.deleteVendorByCVenCode(cVenCode);
    }
}
